import time

from selenium.webdriver.common.by import By
from pom.base_page import BasePage


class AuditManagePage(BasePage):
    def user_auth(self):
        self.driver.find_element(By.XPATH, '//div[2]/div/div[1]/div[2]/div[1]/div/ul/div[7]/li/ul/div[1]/a/li').click()

        time.sleep(2)
        account = self.driver.find_element(By.XPATH, '//div[2]/div/div[2]//div/div[2]/div[3]//tr[1]/td[3]/div').text
        category = self.driver.find_element(By.XPATH, '//div[2]/div/div[2]//div/div[2]/div[3]//tr[1]/td[6]/div/span').text
        print(account, category, "*********************")

        assert account == "cxf"
        assert category == "个人用户"

    def audit_manage(self):
        self.driver.find_element(By.XPATH, '//div[2]/div/div[1]/div[2]/div[1]/div/ul/div[7]/li/ul/div[2]/a/li').click()

        time.sleep(2)
        sponsor = self.driver.find_element(By.XPATH, '//div[2]/div/div[2]//div/div[2]/div[3]//tr[1]/td[3]/div').text
        tittle = self.driver.find_element(By.XPATH, '//div[2]/div/div[2]//div/div[2]/div[3]//tr[1]/td[5]/div').text
        print(sponsor, tittle, "*************************")

        assert sponsor == "admin"
        assert tittle == "审核典型应用-注册应用12"
